﻿<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:metro="clr-namespace:MetroUI;assembly=MetroUI" 
        xmlns:this="clr-namespace:TM.PowerPointController.Server" 
        xmlns:System="clr-namespace:System;assembly=mscorlib" 
        x:Name="window" 
        x:Class="TM.PowerPointController.Server.MainWindow"
        SourceInitialized="Window_SourceInitialized"
        Height="360" Width="640"
        WindowStyle="None" 
        AllowsTransparency="True"
        Foreground="White"
        FontFamily="Microsoft YaHei"
        Icon="/TM.PowerPointController.Server;component/Resource/icon.png" WindowStartupLocation="CenterScreen">
    <Window.Resources>
        <this:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"/>
        <Style x:Key="MetroLink" TargetType="{x:Type Hyperlink}">
            <Setter Property="TextBlock.TextDecorations" Value="{x:Null}"/>
            <Setter Property="Foreground" Value="Gray"/>
            <Setter Property="FontSize" Value="10"/>
            <Setter Property="FontFamily" Value="Microsoft YaHei"/>
            <Setter Property="Cursor" Value="Arrow"/>
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Foreground" Value="White" />
                </Trigger>
            </Style.Triggers>
        </Style>
        <Style x:Key="MetroSmallHeader" TargetType="{x:Type TextBlock}">
            <Setter Property="FontSize" Value="10"/>
        </Style>
		<Style x:Key="SettingItemTitle" TargetType="{x:Type TextBlock}">
            <Setter Property="FontSize" Value="12"/>
			<Setter Property="Margin" Value="0,0,12,0"/>
			<Setter Property="VerticalAlignment" Value="Center"/>
        </Style>
        <Style TargetType="{x:Type Button}" x:Key="ConnectionIndicatorStyle">
            <Setter Property="Foreground" Value="Gray"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <StackPanel Orientation="Horizontal">
                            <StackPanel Margin="0,5,0,0" Visibility="Visible">
                                <TextBlock HorizontalAlignment="Right" Text="{StaticResource NoDevice}"/>
                                <TextBlock FontSize="9" HorizontalAlignment="Right" Text="{StaticResource ClickToConnect}"/>
                            </StackPanel>
                            <Canvas Margin="6,0,0,0" Width="36" Height="36">
                                <Image Source="/Resource/phone_logo.png" Height="30" Width="18" Canvas.Left="9" Canvas.Top="3"/>
                                <Rectangle Height="36" Width="36" Fill="{Binding StatusColor}"/>
                                <Rectangle Height="36" Width="36" x:Name="rectStatusHighlight" Visibility="Collapsed">
                                    <Rectangle.Fill>
                                        <SolidColorBrush Color="Gray" Opacity="0.4"/>
                                    </Rectangle.Fill>
                                </Rectangle>
                            </Canvas>
                        </StackPanel>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Foreground" Value="White"/>
                                <Setter TargetName="rectStatusHighlight" Property="Visibility" Value="Visible"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style TargetType="{x:Type ListBoxItem}" x:Key="PivotHeaders">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ListBoxItem}">
                        <TextBlock x:Name="TextBlock" Text="{TemplateBinding Content}" Foreground="Gray" FontSize="24" Margin="0,0,20,0" FontWeight="Thin"/>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="TextBlock" Property="Foreground" Value="Gray"/>
                            </Trigger>
                            <Trigger Property="IsSelected" Value="true">
                                <Setter TargetName="TextBlock" Property="Foreground" Value="White"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Storyboard x:Key="GridFadeInStoryboard">
        	<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="pivotRecent">
        		<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
        		<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="1"/>
        	</DoubleAnimationUsingKeyFrames>
        </Storyboard>
		<Storyboard x:Key="SettingGridFadeInStoryboard">
        	<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="pivotSetting">
        		<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
        		<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="1"/>
        	</DoubleAnimationUsingKeyFrames>
        </Storyboard>
    	<!--TextBox Style-->
    	<Style x:Key="TextBoxStyle" TargetType="{x:Type TextBox}">
    		<Setter Property="FontFamily" Value="{DynamicResource ContentFontFamily}"/>
    		<Setter Property="FontSize" Value="{DynamicResource ContentFontSize}"/>
    		<Setter Property="BorderThickness" Value="1"/>
    		<Setter Property="MinHeight" Value="26"/>
    		<Setter Property="Background" Value="{DynamicResource ControlBackgroundBrush}"/>
    		<Setter Property="Foreground" Value="{DynamicResource TextBrush}"/>
    		<Setter Property="Padding" Value="0"/>
    		<Setter Property="BorderBrush" Value="{DynamicResource TextBoxBorderBrush}"/>
    		<Setter Property="Template">
    			<Setter.Value>
    				<ControlTemplate TargetType="{x:Type TextBox}">
    					<Grid>
    						<VisualStateManager.VisualStateGroups>
    							<VisualStateGroup x:Name="CommonStates">
    								<VisualState x:Name="Normal"/>
    								<VisualState x:Name="MouseOver">
    									<Storyboard>
    										<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="FocusRectangle" />
    									</Storyboard>
    								</VisualState>
    								<VisualState x:Name="Disabled">
    									<Storyboard>
    										<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledVisualElement">
    											<SplineDoubleKeyFrame KeyTime="0" Value="1"/>
    										</DoubleAnimationUsingKeyFrames>
    									</Storyboard>
    								</VisualState>
    								<VisualState x:Name="ReadOnly">
    									<Storyboard>
    										<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ReadOnlyVisualElement">
    											<SplineDoubleKeyFrame KeyTime="0" Value="1"/>
    										</DoubleAnimationUsingKeyFrames>
    									</Storyboard>
    								</VisualState>
    							</VisualStateGroup>
    							<VisualStateGroup x:Name="FocusStates">
    								<VisualState x:Name="Focused">
    									<Storyboard>
    										<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="FocusRectangle" />
    										<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="FocusInnerRectangle"/>
    									</Storyboard>
    								</VisualState>
    								<VisualState x:Name="Unfocused">
    									<Storyboard/>
    								</VisualState>
    							</VisualStateGroup>
    							<VisualStateGroup x:Name="ValidationStates">
    								<VisualState x:Name="Valid"/>
    								<VisualState x:Name="InvalidUnfocused">
    									<Storyboard>
    										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="ValidationErrorElement">
    											<DiscreteObjectKeyFrame KeyTime="0">
    												<DiscreteObjectKeyFrame.Value>
    													<Visibility>Visible</Visibility>
    												</DiscreteObjectKeyFrame.Value>
    											</DiscreteObjectKeyFrame>
    										</ObjectAnimationUsingKeyFrames>
    									</Storyboard>
    								</VisualState>
    								<VisualState x:Name="InvalidFocused">
    									<Storyboard>
    										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="ValidationErrorElement">
    											<DiscreteObjectKeyFrame KeyTime="0">
    												<DiscreteObjectKeyFrame.Value>
    													<Visibility>Visible</Visibility>
    												</DiscreteObjectKeyFrame.Value>
    											</DiscreteObjectKeyFrame>
    										</ObjectAnimationUsingKeyFrames>
    										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsOpen" Storyboard.TargetName="validationTooltip">
    											<DiscreteObjectKeyFrame KeyTime="0">
    												<DiscreteObjectKeyFrame.Value>
    													<System:Boolean>True</System:Boolean>
    												</DiscreteObjectKeyFrame.Value>
    											</DiscreteObjectKeyFrame>
    										</ObjectAnimationUsingKeyFrames>
    									</Storyboard>
    								</VisualState>
    							</VisualStateGroup>
    						</VisualStateManager.VisualStateGroups>
    						<Rectangle x:Name="Base" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="{TemplateBinding BorderThickness}" Opacity="1" Fill="{TemplateBinding Background}" />
    						<Rectangle x:Name="FocusRectangle" StrokeThickness="{TemplateBinding BorderThickness}" Opacity="0" Stroke="{DynamicResource TextBoxMouseOverBorderBrush}" />
    						<Rectangle x:Name="FocusInnerRectangle" StrokeThickness="{TemplateBinding BorderThickness}" Opacity="0" Margin="0" Stroke="{DynamicResource TextBoxMouseOverInnerBorderBrush}" />
    						<Grid Margin="0,1,0,0">
    							<Border x:Name="ReadOnlyVisualElement" Background="{x:Null}" Opacity="0"/>
    							<Grid >
    								<ScrollViewer x:Name="PART_ContentHost" BorderThickness="0" IsTabStop="False" Margin="4,2,2,2" VerticalAlignment="Stretch" Background="{x:Null}"/>
    							</Grid>
    						</Grid>
    						<Rectangle x:Name="DisabledVisualElement" Stroke="{DynamicResource ControlsDisabledBrush}" StrokeThickness="{TemplateBinding BorderThickness}" Fill="{DynamicResource ControlsDisabledBrush}" IsHitTestVisible="False" Opacity="0"/>
    						<Border x:Name="ValidationErrorElement" BorderBrush="{DynamicResource ControlsValidationBrush}" BorderThickness="1" Visibility="Collapsed">
    							<ToolTipService.ToolTip>
    								<ToolTip x:Name="validationTooltip" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" Placement="Right" PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}" Template="{DynamicResource ValidationToolTipTemplate}">
    									<ToolTip.Triggers>
    										<EventTrigger RoutedEvent="FrameworkElement.Loaded">
    											<BeginStoryboard>
    												<Storyboard>
    													<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsHitTestVisible" Storyboard.TargetName="validationTooltip">
    														<DiscreteObjectKeyFrame KeyTime="0">
    															<DiscreteObjectKeyFrame.Value>
    																<System:Boolean>true</System:Boolean>
    															</DiscreteObjectKeyFrame.Value>
    														</DiscreteObjectKeyFrame>
    													</ObjectAnimationUsingKeyFrames>
    												</Storyboard>
    											</BeginStoryboard>
    										</EventTrigger>
    									</ToolTip.Triggers>
    								</ToolTip>
    							</ToolTipService.ToolTip>
    							<Grid Background="Transparent" HorizontalAlignment="Right" Height="12" Margin="1,-4,-4,0" VerticalAlignment="Top" Width="12">
    								<Path Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 z" Fill="{DynamicResource ValidationBrush5}" Margin="1,3,0,0"/>
    								<Path Data="M 0,0 L2,0 L 8,6 L8,8" Fill="{DynamicResource WhiteColorBrush}" Margin="1,3,0,0"/>
    							</Grid>
    						</Border>
    					</Grid>
    				</ControlTemplate>
    			</Setter.Value>
    		</Setter>
    	</Style>
    	<Style x:Key="ButtonStyle" TargetType="{x:Type Button}">
    		<Setter Property="MinHeight" Value="25" />
    		<Setter Property="FontSize" Value="12" />
    		<Setter Property="FontFamily" Value="{DynamicResource DefaultFont}" />
    		<Setter Property="Background" Value="{DynamicResource GrayBrush7}"/>
    		<Setter Property="BorderBrush" Value="{DynamicResource TextBoxBorderBrush}"/>
    		<Setter Property="Foreground" Value="{DynamicResource TextBrush}"/>
    		<Setter Property="BorderThickness" Value="1"/>
    		<Setter Property="Template">
    			<Setter.Value>
    				<ControlTemplate TargetType="{x:Type Button}">
    					<Grid>
    						<VisualStateManager.VisualStateGroups>
    							<VisualStateGroup x:Name="CommonStates">
    								<VisualState x:Name="Normal"/>
    								<VisualState x:Name="MouseOver">
    									<Storyboard>
    										<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="MouseOverBorder">
    											<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
    										</DoubleAnimationUsingKeyFrames>
    									</Storyboard>
    								</VisualState>
    								<VisualState x:Name="Pressed">
    									<Storyboard>
    										<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="PressedBorder">
    											<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
    										</DoubleAnimationUsingKeyFrames>
    									</Storyboard>
    								</VisualState>
    								<VisualState x:Name="Disabled">
    									<Storyboard>
    										<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledVisualElement">
    											<SplineDoubleKeyFrame KeyTime="0" Value="0.7"/>
    										</DoubleAnimationUsingKeyFrames>
    										<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="contentPresenter">
    											<EasingDoubleKeyFrame KeyTime="0" Value="0.3"/>
    										</DoubleAnimationUsingKeyFrames>
    									</Storyboard>
    								</VisualState>
    							</VisualStateGroup>
    							<VisualStateGroup x:Name="FocusStates">
    								<VisualState x:Name="Focused">
    									<Storyboard>
    										<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="FocusRectangle">
    											<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
    										</DoubleAnimationUsingKeyFrames>
    										<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="FocusInnerRectangle">
    											<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
    										</DoubleAnimationUsingKeyFrames>

    									</Storyboard>
    								</VisualState>
    								<VisualState x:Name="Unfocused"/>
    							</VisualStateGroup>
    						</VisualStateManager.VisualStateGroups>
    						<Border x:Name="Background" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}"/>
    						<Rectangle x:Name="DisabledVisualElement" Fill="{DynamicResource ControlsDisabledBrush}" IsHitTestVisible="false" Opacity="0"/>
    						<Border x:Name="MouseOverBorder" Background="{DynamicResource GrayBrush8}" BorderThickness="{TemplateBinding BorderThickness}"  Opacity="0"/>
    						<Border x:Name="PressedBorder" Background="{DynamicResource GrayBrush5}" BorderThickness="{TemplateBinding BorderThickness}" Opacity="0"/>
    						<Rectangle x:Name="FocusRectangle" Stroke="{DynamicResource TextBoxMouseOverInnerBorderBrush}" RadiusY="4" RadiusX="4" Margin="-1" Opacity="0" />
    						<Rectangle x:Name="FocusInnerRectangle" StrokeThickness="{TemplateBinding BorderThickness}" Stroke="{DynamicResource TextBoxMouseOverBorderBrush}" Opacity="0" />
    						<ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content, Converter={StaticResource ToUpperConverter}}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
    					</Grid>
    				</ControlTemplate>
    			</Setter.Value>
    		</Setter>
    	</Style>

    </Window.Resources>
	<Window.Title>
		<StaticResource ResourceKey="ApplicationTitle"/>
	</Window.Title>
	<Window.Triggers>
		<EventTrigger RoutedEvent="Selector.Selected" SourceName="headerRecent">
			<BeginStoryboard Storyboard="{StaticResource GridFadeInStoryboard}"/>
		</EventTrigger>
		<EventTrigger RoutedEvent="Selector.Selected" SourceName="headerSetting">
			<BeginStoryboard Storyboard="{StaticResource SettingGridFadeInStoryboard}"/>
		</EventTrigger>
	</Window.Triggers>
	<Window.Background>
		<LinearGradientBrush EndPoint="0.5,1" MappingMode="RelativeToBoundingBox" StartPoint="0.5,0">
			<GradientStop Color="#FD031625" Offset="0.01"/>
			<GradientStop Color="#FD0C1E2D" Offset="1"/>
		</LinearGradientBrush>
	</Window.Background>
    <Grid>
        <Grid.ColumnDefinitions>
        	<ColumnDefinition/>
        	<ColumnDefinition/>
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
        	<RowDefinition Height="40"/>
            <!-- Zune Metro has 36px on the upper bar -->
        	<RowDefinition Height="60"/>
        	<RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <Rectangle Fill="#000C1E2D" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="0" PreviewMouseDown="Rectangle_PreviewMouseDown"/>

        <TextBlock x:Name="textBlock" Style="{StaticResource MetroSmallHeader}" Margin="0,5,0,0" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Top" Visibility="Collapsed">
            <Hyperlink Style="{StaticResource MetroLink}" x:Name="btnAbout" Click="btnAbout_Click">
                <Run Text="{StaticResource About}"/>
            </Hyperlink>
        </TextBlock>

        <StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="1" HorizontalAlignment="Right" Margin="0,0,12,0" VerticalAlignment="Top">
            <Grid Margin="0,2,18,0" x:Name="gridConnectionIndicator" VerticalAlignment="Top">
                <Button x:Name="btnIndicator"  Style="{StaticResource ConnectionIndicatorStyle}"/>
            </Grid>
            <metro:ImageButton Image="/Resource/minimise.png" HoverImage="/Resource/minimise_highlighted.png" Height="8" Width="7" x:Name="btnMinimize" Margin="0,0,6,0" Click="btnMinimize_Click" ToolTip="{StaticResource MinimizeApplication}"/>
            <!--<metro:ImageButton Image="/Resource/maximise.png" HoverImage="/Resource/maximise_highlighted.png" Height="8" Width="9" x:Name="btnMaximise" Margin="0,0,6,0" Click="btnMaximise_Click" ToolTip="{StaticResource MaximiseApplication}"/>
            <metro:ImageButton Image="/Resource/restore.png" HoverImage="/Resource/restore_highlighted.png" Height="9" Width="9" x:Name="btnRestore" Visibility="Collapsed" Margin="0,0,6,0" Click="btnRestore_Click" ToolTip="{StaticResource RestoreApplication}"/>-->
            <metro:ImageButton Image="/Resource/exit.png" HoverImage="/Resource/exit_highlighted.png" Height="7" Width="8" x:Name="btnClose" Click="btnClose_Click" ToolTip="{StaticResource ExitApplication}"/>
        </StackPanel>

        <ListBox x:Name="pivotHeaders" Grid.Row="1" Grid.ColumnSpan="2" Background="Transparent" ItemContainerStyle="{StaticResource PivotHeaders}" BorderThickness="0" Margin="12,0,0,24">
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <StackPanel Orientation="Horizontal"/>
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
            <ListBoxItem x:Name="headerRecent" Selected="RecentSelected" Content="{StaticResource Recent}"/>
            <ListBoxItem x:Name="headerSetting" Selected="SettingSelected" Content="{StaticResource Setting}"/>
            <ListBoxItem x:Name="headerAbout" Selected="AboutSelected" Content="{StaticResource About}"/>
        </ListBox>

        <Grid Grid.Row="2" Grid.ColumnSpan="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="12,0,12,12">
            <Grid x:Name="pivotRecent" Visibility="Collapsed">
                <ListBox x:Name="recentFileList" ScrollViewer.HorizontalScrollBarVisibility="Disabled" Background="Transparent" BorderThickness="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                    <ListBox.ItemsPanel>
                        <ItemsPanelTemplate>
                            <WrapPanel HorizontalAlignment="Left" VerticalAlignment="Top" Orientation="Horizontal"/>
                        </ItemsPanelTemplate>
                    </ListBox.ItemsPanel>
                    <ListBoxItem Margin="0,0,5,5" Width="80" Height="80">
                        <Image Source="/Tmp/1.png" Stretch="Fill"/>
                    </ListBoxItem>
                    <ListBoxItem Margin="0,0,5,5" Width="80" Height="80">
                        <Image Source="/Tmp/2.png" Width="80" Height="80"/>
                    </ListBoxItem>
                    <ListBoxItem Margin="0,0,5,5" Width="80" Height="80">
                        <Image Source="/Tmp/3.png" Width="80" Height="80"/>
                    </ListBoxItem>
                    <ListBoxItem Margin="0,0,5,5" Width="80" Height="80">
                        <Image Source="/Tmp/4.png" Width="80" Height="80"/>
                    </ListBoxItem>
                    <ListBoxItem Margin="0,0,5,5" Width="80" Height="80">
                        <Image Source="/Tmp/5.png" Width="80" Height="80"/>
                    </ListBoxItem>
                    <ListBoxItem Margin="0,0,5,5" Width="80" Height="80">
                        <Image Source="/Tmp/6.png" Width="80" Height="80"/>
                    </ListBoxItem>
                    <ListBoxItem Margin="0,0,5,5" Width="80" Height="80">
                        <Image Source="/Tmp/2.png" Width="80" Height="80"/>
                    </ListBoxItem>
                    <ListBoxItem Margin="0,0,5,5" Width="80" Height="80">
                        <Image Source="/Tmp/3.png" Width="80" Height="80"/>
                    </ListBoxItem>
                    <ListBoxItem Margin="0,0,5,5" Width="80" Height="80">
                        <Image Source="/Tmp/4.png" Width="80" Height="80"/>
                    </ListBoxItem>
                    <ListBoxItem Margin="0,0,5,5" Width="80" Height="80">
                        <Image Source="/Tmp/5.png" Width="80" Height="80"/>
                    </ListBoxItem>
                </ListBox>
            </Grid>
        	<Grid x:Name="pivotSetting" Visibility="Collapsed">
        		<Grid.ColumnDefinitions>
        			<ColumnDefinition Width="Auto"/> 
					<ColumnDefinition Width="Auto"/>    		   		
				</Grid.ColumnDefinitions>
				<Grid.RowDefinitions>
					<RowDefinition Height="36"/>
					<RowDefinition Height="36"/>
					<RowDefinition Height="Auto"/>
				</Grid.RowDefinitions>
				<TextBlock Text="文档目录" Grid.Column="0" Grid.Row="0" Style="{DynamicResource SettingItemTitle}"/>
				<StackPanel Orientation="Horizontal" Height="24" VerticalAlignment="Center" Grid.Column="1" Grid.Row="0">
						<Button Content="浏览" Margin="0,0,12,0" Width="80" Style="{DynamicResource ButtonStyle}" FontFamily="Microsoft YaHei"/>
        				<TextBlock Text="C:\Users\huangzhiming.RDEV\Documents" VerticalAlignment="Center" Foreground="#FFA3A3A3"  />
        		</StackPanel>
				
				<TextBlock Text="连接密码" Grid.Column="0" Grid.Row="1" Style="{DynamicResource SettingItemTitle}"/>
                <StackPanel Orientation="Horizontal" Height="24" VerticalAlignment="Center" Grid.Column="1" Grid.Row="1">
                    <TextBox Width="240" Height="24" Margin="0,0,12,0" BorderThickness="0" Style="{DynamicResource TextBoxStyle}" HorizontalAlignment="Left"  />
                    <Button Content="随机生成"  Width="80" Style="{DynamicResource ButtonStyle}" FontFamily="Microsoft YaHei"/>
                </StackPanel>
            </Grid>
            <Grid x:Name="pivotAbout" Visibility="Collapsed">
                <StackPanel>
                    <StackPanel Orientation="Horizontal" Height="25" Margin="0,0,0,6">
                        <Image Source="/Resource/icon.png"/>
                        <TextBlock VerticalAlignment="Center" FontFamily="Segoe WP" FontSize="25" Margin="10,0,0,0" FontWeight="Thin" Text="{StaticResource ApplicationTitle}"/>
                    </StackPanel>

                    <StackPanel>
                        <TextBlock><Hyperlink x:Name="linkWebsite" NavigateUri="http://www.topming.com"><Run Text="http://www.topming.com"/></Hyperlink></TextBlock>
                        <TextBlock FontSize="12"><Run Text="COPYRIGHT (C) 2011 TOPMING"/><LineBreak/><Run Text="LICENSED UNDER THE Ms-Pl"/></TextBlock>
                    </StackPanel>

                    <TextBlock Style="{StaticResource MetroSmallHeader}" Margin="0,6,0,0"><Run Text="CHANGELOG"/></TextBlock>
                    <ScrollViewer Height="125" HorizontalAlignment="Stretch"  Margin="0,6,0,0">
                        <StackPanel Margin="0,0,5,0">
                            <Separator Margin="0,5,0,5"/>

                            <TextBlock Style="{StaticResource MetroSmallHeader}" Margin="0,0,0,5"><Run Text="VERSION 1.4.9.1 - 7/12/2011"/></TextBlock>
                            <TextBlock TextWrapping="Wrap"><Run Text="• Minor bug fix: BUG 14: any mouse button click, except left click, on the window drag area would cause a crash (Thanks Doug!)"/></TextBlock>

                            <Separator Margin="0,5,0,5"/>

                            <TextBlock Style="{StaticResource MetroSmallHeader}" Margin="0,0,0,5"><Run Text="VERSION 1.4.9 - 27/11/2011"/></TextBlock>
                            <TextBlock TextWrapping="Wrap"><Run Text="• Support Windows XP (requested by Sergoreg, Thanks!)"/></TextBlock>

                            <Separator Margin="0,5,0,5"/>

                            <TextBlock Style="{StaticResource MetroSmallHeader}" Margin="0,0,0,5"><Run Text="VERSION 1.4.9 - 27/11/2011"/></TextBlock>
                            <TextBlock TextWrapping="Wrap"><Run Text="• Support Windows XP (requested by Sergoreg, Thanks!)"/></TextBlock>

                            <Separator Margin="0,5,0,5"/>

                            <TextBlock Style="{StaticResource MetroSmallHeader}" Margin="0,0,0,5"><Run Text="VERSION 1.4.9 - 27/11/2011"/></TextBlock>
                            <TextBlock TextWrapping="Wrap"><Run Text="• Support Windows XP (requested by Sergoreg, Thanks!)"/></TextBlock>
                        </StackPanel>
                    </ScrollViewer>
                 </StackPanel>
            </Grid>
        </Grid>
        
        <!--关于窗口-->
        <metro:MetroDialog x:Name="dialogAbout" Background="#FD0C1E2D" Visibility="Collapsed" Grid.ColumnSpan="2" Grid.RowSpan="3" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
            
        </metro:MetroDialog>
    </Grid>
</Window>
